<template>


	<view class="item" v-for="(item,index) in props.list" :key="index" @click="emit('emitItem',item)">
		<view class="item-type">
			<view class="item-heard-left">
				<text class="color-style-1">{{item.month}}</text>

			</view>  
			<view class="item-user-left">
				<image src="../../../../static/forgettingIcon1.png" mode="" class="item-conetnt-img" />
				<text class="text-color-4">{{item.user.username}}</text>
				<text v-if="item.user.grade">({{item.user.grade}})</text>
			</view>
			<view class="btn" @click.stop="emitOpen(item,index)" v-if="item.examine_state===0">
				审核
			</view> 
		</view>
		<view class="item-type  item-type1">

			<view class="item-type-left">
				<text class="text-color-4">状态：</text>
				<text class="text-color-2">{{item.state===0?'未通过':'通过'}}</text>
			</view>
			<view class="item-type-right"> 
				<text class="text-color-4">审核时间：</text>
				<text class="text-color-3">{{item.examine_state===0?'待审核':item.examine_time}}</text>
			</view>
		</view>

		<image class="item-path" src="../../../../static/messageIcon.png" mode=""></image>
	</view>

</template>

<script setup>
	import {
		ref
	} from 'vue';
	const emit = defineEmits(['emitOpen'])
	const props = defineProps({
		list: {
			type: Object,
			default: () => {
				return []
			}
		},
	})
	const emitOpen = (item, index) => {
		emit('emitOpen', item, index)
	}
</script>

<style lang="scss" scoped>
	.list {
		display: flex;
		flex-direction: column;
		width: 100%;
	}

	text {
		font-size: 26rpx;
	}

	.item {
		margin: 0 auto;
		padding: 24rpx 24rpx;
		padding-right: 130rpx;
		position: relative;
		display: flex;
		flex-direction: column;
		width: 670rpx;
		min-height: 170rpx;
		opacity: 1;
		border-radius: 9rpx;
		background: rgba(255, 255, 255, 1);
		border: 2rpx solid rgba(236, 236, 236, 1);
		margin-top: 20rpx;
	}

	.item-type {
		display: flex;
		justify-content: space-between;
		align-items: center;
	}

	.item-type1 {
		margin-top: 32rpx;
	}


	.item-path {
		position: absolute;
		top: 50%;
		transform: rotate(-90deg) translateX(50%);
		right: 12rpx;
		width: 32rpx;
		height: 32rpx;
	}

	.item-user-left {
		.item-conetnt-img {
			width: 28rpx;
			height: 28rpx;
			margin-right: 8rpx;
		}
	}

	.btn {

		padding: 8rpx 16rpx;
		opacity: 1;
		border-radius: 5.26rpx;
		background: linear-gradient(90deg, rgba(121, 72, 234, 1) 0%, rgba(172, 51, 193, 1) 100%);
		color: #fff;
		font-size: 32rpx;
		line-height: 40rpx;
	}
</style>